播歌,應該是擺了智慧音箱之後,除了找我的手機以外的最常用功能了吧。
https://github.com/actions-on-google/dialogflow-conversation-components-nodejs
app.intent('media response', (conv) => {
if (!conv.hasAudioPlayback) {
conv.ask('Sorry, this device does not support audio playback.');
return;
}
conv.ask('This is the first simple response for a media response');
conv.ask(new MediaObject({
name: 'Jazz in Paris',
url: 'http://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
description: 'A funky Jazz tune',
icon: new Image({
url: 'http://storage.googleapis.com/automotive-media/album_art.jpg',
alt: 'Media icon',
}),
}));
});
像這樣去倒mediaObject就可以了。